﻿using BootstrapBlazor.Components;
using Microsoft.AspNetCore.Components;
using BBCore.Application.OracleApplication.ZDL.Interface;
using System.Diagnostics.CodeAnalysis;

namespace BBCore.Server.Components.Pages.ZDL_WEB.ZDL
{
    public partial class Get_Org
    {
        [Parameter]
        public int ORGID { get; set; }
        [Parameter]
        public EventCallback<int> ORGIDChanged { get; set; }

        private List<SelectedItem>? Items { get; set; }

        private async Task OnSelectedItemChanged(SelectedItem e)
        {
            ORGID = string.IsNullOrEmpty(e.Value) ? 0 : int.Parse(e.Value);
            await ORGIDChanged.InvokeAsync(ORGID);
        }
        [Inject]
        [NotNull]
         IORGService? IORGService { get; set; }
        protected override void OnInitialized()
        {
            Items = IORGService.GetOrg();
        }

    }
}
